package com.itheima.API;

import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;

public class A0_1ZoneIdDemo {
    public static void main(String[] args) {
        //获取时区(标准时间)
//        Instant now = Instant.now();
//        System.out.println(now);

        //根据（秒，毫秒，纳秒）获取instant对象
//        Instant instant = Instant.ofEpochMilli(0L);
//        System.out.println(instant);

        //指定时区
        ZonedDateTime zonedDateTime = Instant.now().atZone(ZoneId.of("Asia/Shanghai"));
        System.out.println(zonedDateTime);

    }
}
